package com.mi.system.dto.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * Dict item request DTO
 *
 * @author jin_huaquan
 * @version 1.0
 * @date 2021/11/3 9:13
 */
@ApiModel(value = "DictItemRequestDTO对象", description = "字典类型请求信息")
@Data
public class DictItemRequestDTO {

    @ApiModelProperty(value = "字典类型ID", required = true, dataType = "java.lang.String")
    @NotNull(message = "字典类型ID不能为空")
    private Long dictId;

    @ApiModelProperty(value = "数据值", required = true)
    @NotBlank(message = "字典项数据值不能为空")
    @Length(min = 1, max = 32, message = "字典项数据值的字符长度不能超过32个")
    private String value;

    @ApiModelProperty("标签")
    @Length(max = 32, message = "字典项标签的字符长度不能超过32个")
    private String label;

    @ApiModelProperty(value = "字典类型", required = true)
    @NotBlank(message = "字典项的字典类型不能为空")
    @Length(max = 64, message = "字典项的字典类型字符长度不能超过64个")
    private String type;

    @ApiModelProperty("描述")
    @Length(max = 128, message = "字典项的描述字符长度不能超过128个")
    private String description;

    @ApiModelProperty("排序值")
    @Range(max = 9999, message = "排序值最大不能超过9999")
    private Integer sort;

    @ApiModelProperty("备注信息")
    @Length(max = 128, message = "字典项的备注字符长度不能超过128个")
    private String remarks;
}
